#include<iostream>
using namespace std;
int n;
struct node{
    int d;
    node *next;
};

typedef node* link;

link head = new node;
int main() {
    scanf("%d", &n);
    head->next = NULL;
    for(int i = 1; i <= n; ++i){
        link now = new node;
        scanf("%d", &(now->d));
        link p=new node;
        p = head;
        while(1){
            if(p->next == NULL){
                now->next = NULL;
                p->next = now;
                break;
            }
            if((p->next->d) < (now->d)){
                now->next = p->next;
                p->next = now;
                break;
            }
            p = p->next;
        }
    }
    link p = new node;
    p = head;
    while(n--){
        p = p->next;
        cout<< p->d <<" ";
    }
    return 0;
}